﻿<UserControl x:Class="Black.Minecraft.Editor.Views.DataViews.InventoryItemDataView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             x:Name="root"
             Width="32"
             Height="32">

    <Grid AllowDrop="True"
          Background="Transparent"
          DragEnter="OnDragEnter"
          Drop="OnDrop"
          MouseDown="OnMouseDown"
          ToolTipService.IsEnabled="{Binding IsNotChunk}">

        <Grid.ToolTip>
            <TextBlock Text="{Binding ToolTip}" />
        </Grid.ToolTip>

        <Image Width="28"
               Height="28"
               HorizontalAlignment="Center"
               VerticalAlignment="Center"
               Source="{Binding Definition.Image}"
               Stretch="Fill"
               Visibility="{Binding Definition.HaveImage,
                                    Converter={StaticResource BoolToVisibilityConverter}}" />

        <TextBlock Margin="0,0,2,2"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Bottom"
                   FontSize="11"
                   FontWeight="Bold"
                   Foreground="White"
                   Text="{Binding Count}"
                   Visibility="{Binding IsNotSingle,
                                        Converter={StaticResource BoolToVisibilityConverter}}" />

        <Rectangle Width="2"
                   HorizontalAlignment="Left"
                   VerticalAlignment="Stretch"
                   Fill="Red"
                   Visibility="{Binding IsSelected,
                                        Converter={StaticResource BoolToVisibilityConverter}}" />
        <Rectangle Width="2"
                   HorizontalAlignment="Right"
                   VerticalAlignment="Stretch"
                   Fill="Red"
                   Visibility="{Binding IsSelected,
                                        Converter={StaticResource BoolToVisibilityConverter}}" />
        <Rectangle Height="2"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Top"
                   Fill="Red"
                   Visibility="{Binding IsSelected,
                                        Converter={StaticResource BoolToVisibilityConverter}}" />
        <Rectangle Height="2"
                   HorizontalAlignment="Stretch"
                   VerticalAlignment="Bottom"
                   Fill="Red"
                   Visibility="{Binding IsSelected,
                                        Converter={StaticResource BoolToVisibilityConverter}}" />

    </Grid>

</UserControl>
